<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>美兰数据文化馆与图书馆</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/huazhi/lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/huazhi/css/public.css" media="all">
    <link rel="shortcut icon" href="<%=request.getContextPath()%>/huazhi/images/favicon.ico"/>
</head>
<style>
    .video{
        display: block;
        width: 80%;
        height: auto;
    }
    .margin15{
        margin: 15px;
    }
</style>
<body>
<input type="hidden" id="id">
<div class="layui-fluid">
    <div class="layui-card">
                <form class="layui-form" lay-filter="component-form-element" id="formAttribute1" action="">
                    <div class="layui-card-body" style="padding:0px;">
                        <div class="layui-tab layui-tab-card">
                            <ul class="layui-tab-title">
                                <li class="layui-this">
                                    巡检图片
                                </li>
                                <li>
                                    巡检视频
                                </li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <div class="layui-card-body layui-row layui-col-space10">
                                        <div class="layui-col-md12">
                                            <div class="layui-col-md12" id="doman4image">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-tab-item">
                                    <div class="layui-card-body layui-row layui-col-space10">
                                        <div class="layui-col-md12" id="videos">

                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
</div>
<script src="<%=request.getContextPath()%>/huazhi/lib/layui-v2.5.5/layui.all.js"></script>
<script>
    function child(id){
        layui.use(['carousel'], function() {
            var $ = layui.$,
                carousel=layui.carousel;
            $.ajax({
                type: "post",
                url: "<%=request.getContextPath()%>/rest/inspection/getByIdInspection",
                dataType: "json",
                async: false,
                data:"id="+id,
                success: function (data) {
                    for(var i=0;i<data.data[0].imageList.length;i++){
                        var imageli='<div class="layui-col-md2" style="margin: 8px;"><div class="cmdlist-container"><a href="javascript:;" onclick="imageonclick(\''+id+'\')"><img  src="'+data.data[0].imageList[i].src+'"  style="width:100%;height:100%;"/></a></div></div>'
                        $("#doman4image").append(imageli)
                    }

                    if(data.data[0].vodeo==""){

                    }else {
                        var video = '<div class="video" id="video" data-url="' + data.data[0].vodeo + '" style="width: 100%;"></div>'
                        $("#videos").append(video)
                    }
                }
            });

            var vUrl = $('#video').data('url');
            if(vUrl==""){

            }else {
                videoObject = {
                    container: '#video',
                    loop: false,//播放结束后是否循环播放
                    autoplay: false,//是否自动播放
                    video: [
                        [vUrl, 'video/mp4']
                    ]
                };
                var player = new ckplayer(videoObject);
            }

        });
    }
</script>
</body>
</html>